<?php

namespace app\index\controller;
use app\FrontController;
use think\facade\Db;
use think\facade\Cache;
use think\facade\Validate;
use support\Request;
class TaskController extends FrontController{
    
    public function __construct()
    {
        parent::__construct();
    }
    public function tasksub()
    {
        $param = $this->request->all();
        $tab = array();
        if(isset($param['option'])){
            $tab = array('option'=>$param['option']);
        } else {
            $tab = array('option'=>'');
        }
        $tab = array_merge($tab,$this->assign_arr);
        return view('task/tasksub',$tab);
    }
    public function taskconfirm()
    {
        $tab = $this->assign_arr;
        return view('task/taskconfirm',$tab);
    }
    public function taskdetail($name,$id)
    {
        $get = ['name'=>$name,'taskid'=>$id];
        $ret = array();
        $ret['code'] = 1;
        $ret['msg'] = 'ok';
        if(!isset($get['taskid'])){
            $get['taskid'] = 0;
        }
        if(empty($get['taskid'])){
            $get['taskid'] = 0;
        }
        $ret['id'] = $get['taskid'];
        
        $ret = array_merge($ret,$this->assign_arr);

        return view("task/taskdetail",$ret);
    }
    public function sendtask()
    {
        $get = $this->request->all();
        if(!isset($get['taskid'])){
            $ret['code'] = 0;
            $ret['msg'] = '参数不正确';
            return view("taskdetail",$ret);
        }
        if(empty($get['taskid'])){
            $ret['code'] = 0;
            $ret['msg'] = '参数不正确';
            return view("taskdetail",$ret);
        }
        if(!isset($get['path'])){
            $ret['code'] = 0;
            $ret['msg'] = '参数不正确';
            return view("taskdetail",$ret);
        }
        if(empty($get['path'])){
            $ret['code'] = 0;
            $ret['msg'] = '参数不正确';
            return view("taskdetail",$ret);
        }
        $tab = array('taskid'=>$get['taskid'],'path'=>$get['path']);
        $tab = array_merge($tab,$this->assign_arr);
        return view("task/sendtask",$tab);
    }
    public function arbitration()
    {
        $tab = array("tab"=>"5-1");
        $tab = array_merge($tab,$this->assign_arr);
        return view("task/arbitration",$tab);
    }
    public function successtask()
    {
        $tab = array("tab"=>"4-2");
        $tab = array_merge($tab,$this->assign_arr);
        return view('task/successtask',$tab);
    }
    public function highsearch()
    {
        $tab = $this->assign_arr;
        $tab = array_merge($tab,$this->assign_arr);
        return view('task/highsearch',$tab);
    }
   
}